package com.jake.microservice.provider.jpa.repository;

import com.jake.microservice.provider.jpa.entity.UserEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface UserRepository extends JpaRepository<UserEntity, Integer> {

    @Query(value = "select u from UserEntity u where u.username like concat('%', :username, '%')")
    List<UserEntity> findByUserName(@Param("username") String username);
}
